home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / lang / Python16_Src.lha / Python16_Source / Python / getmtime.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-10  |  399 b   |  23 lines

  1. /* Subroutine to get the last modification time of a file */
  2.  
  3. /* (A separate file because this may be OS dependent) */
  4.  
  5. #include "config.h"
  6.  
  7. #include <stdio.h>
  8. #include <sys/types.h>
  9. #include <sys/stat.h>
  10. #include "protos/getmtime.h"
  11.  
  12. long
  13. PyOS_GetLastModificationTime(path, fp)
  14.     char *path;
  15.     FILE *fp;
  16. {
  17.     struct stat st;
  18.     if (fstat(fileno(fp), &st) != 0)
  19.         return -1;
  20.     else
  21.         return st.st_mtime;
  22. }
  23.